/*
 * @Author: 小豪
 * @Description:
 * @Date: 2024-04-29 14:01:57
 * @LastEditTime: 2024-04-29 14:02:17
 * @FilePath: \zkyjt\gohub\app\cmd\key.go
 */
package cmd

import (
	"gohub/pkg/console"
	"gohub/pkg/helpers"

	"github.com/spf13/cobra"
)

var CmdKey = &cobra.Command{
	Use:   "key",
	Short: "Generate App Key, will print the generated Key",
	Run:   runKeyGenerate,
	Args:  cobra.NoArgs, // 不允许传参
}

func runKeyGenerate(cmd *cobra.Command, args []string) {
	console.Success("---")
	console.Success("App Key:")
	console.Success(helpers.RandomString(32))
	console.Success("---")
	console.Warning("please go to .env file to change the APP_KEY option")
}
